﻿/*
 * @文件描述:主程序
 * @版本:
 * @作者:徐俊鑫
 * @Date:2021-09-22 17:38:26
 */

using System;
using System.Windows.Forms;
using Motor_Control;

namespace Motor_Control
{
    class Program
    {
        // Create a delegate to close down the application in a thread safe way

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            MySocket socket;
            MotorControl motorControl;
            MotorControlView motorControlView;
            Sensors sensors = Sensors.CreateInstance();
            motorControl = MotorControl.CreateInstance();
            Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);


            motorControlView = new MotorControlView();
            sensors.bandView(motorControlView);

            motorControl.bindView(motorControlView);

            socket = new MySocket();
            socket.bindView(motorControlView);
            motorControlView.bandModel(motorControl);
            socket.StartServerAsync();

            Application.Run(motorControlView);
        }

    }
}
